﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace softsales
{
    public partial class Login : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        protected void Page_Init()
        {

            //// TITULO
            Page.Header.Title = "TANKSPAR";

            //// KEYWORDS
            //HtmlMeta keywords = new HtmlMeta();
            //keywords.Name = "keywords";
            //keywords.Content = "workflow";
            //Page.Header.Controls.Add(keywords);

            //HtmlMeta description = new HtmlMeta();
            //description.Name = "description";
            //description.Content = "workflow"

            //// LOAD CSS
            //List<string> lista_css = new List<string>();
            //lista_css.Add("~/assets/css/ui/themes/gray_lightness/ui.css");
            //lista_css.Add("~/assets/css/ui/themes/ui.base.css");
            //lista_css.Add("~/assets/css/charts.css");
            //lista_css.Add("~/assets/css/fg.menu.css");
            //lista_css.Add("~/assets/css/charts.css");


            //foreach (String str in lista_css)
            //{
            //    HtmlLink css = new HtmlLink();
            //    css.Href = str;
            //    css.Attributes["rel"] = "stylesheet";
            //    css.Attributes["type"] = "text/css";
            //    css.Attributes["media"] = "all";
            //    Page.Header.Controls.Add(css);
            //}


            //// LOAD JS
            //List<string> lista_js = new List<string>();


            //lista_js.Add("~/js/jquery-1.7.2/jquery-1.7.2.js");
            //lista_js.Add("~/js/jquery-ui-1.8.20/jquery-ui-1.8.20.min.js");
            //lista_js.Add("~/js/superfish.js");
            //lista_js.Add("~/js/jquery.maskmoney/jquery.maskMoney.js");
            //lista_js.Add("~/js/superfish.js");
            //lista_js.Add("~/js/validacnpjcpf.js");
            //lista_js.Add("~/js/jquery.validate/jquery.validate.js");
            //lista_js.Add("~/js/jquery.masked/jquery.maskedinput-1.3.min.js");
            //lista_js.Add("~/js/softsales.js");
            //lista_js.Add("~/js/custom.js");


            //foreach (String str in lista_js)
            //{
            //    HtmlGenericControl js = new HtmlGenericControl();
            //    js.TagName = "script";
            //    js.Attributes["src"] = str;
            //    js.Attributes["type"] = "text/javascript";
            //    Page.Header.Controls.Add(js);

            //}




        }

        public void MSG_ALERTA(string msg)
        {

            AjaxControlToolkit.ToolkitScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "alert", string.Format("alert('{0}')", msg), true);

        }

        public void MSG_ALERTA(string msg, string redirect, bool window)
        {

            string script = string.Empty;
            if (window)
            {
                script = string.Format("alert('{0}'); window.open('{1}')", msg, redirect);
            }
            else
            {

                script = string.Format("alert('{0}'); location.replace('{1}')", msg, redirect);
            }
            AjaxControlToolkit.ToolkitScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "alert", script, true);

        }

    }
}